package com.youlian.manager.api;

import com.youlian.manager.param.LoginParam;
import com.youlian.manager.param.ParametersUtils;
import com.youlian.manager.param.RegisterParam;


public class UserAPI extends BaseAPI{

	/**
	 * 用户登录入口
	 * @param UserParam
	 * @return
	 * @throws Exception
	 */
	public String login(LoginParam p) throws Exception {

		ParametersUtils params = new ParametersUtils(p);

		params.addStringParam("service", p.getService());
		params.addStringParam("login_id", p.getLogin_id());
		params.addStringParam("password", p.getPassword());

		return doGet(params.getReqURL());
	}
	
	/**
	 * 用户注册入口
	 * @param UserParam
	 * @return
	 * @throws Exception
	 */
	public String register(RegisterParam p) throws Exception {

		ParametersUtils params = new ParametersUtils(p);

		params.addStringParam("service", p.getService());
		params.addStringParam("login_id", p.getLogin_id());
		params.addStringParam("password", p.getPassword());

		return doGet(params.getReqURL());
	}
}
